package com.webframe.servlet;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.webframe.util.ApplicationContextKeeper;


/**
 * 类功能描述：获得spring bean容器
 *
 * @author <a href="mailto:qingyu.meng21@gmail.com">mengqingyu </a>
 * @version $Id: ApplicationContextLoader.java,v 1.2 2010/11/01 07:16:43 chenfuzhong Exp $
 * Create:  2009-12-31 下午01:59:41
 */
public class ApplicationContextLoader extends HttpServlet
{
   public void init(ServletConfig servletConfig) throws ServletException
   {
      ApplicationContext ctx = WebApplicationContextUtils
            .getRequiredWebApplicationContext(servletConfig.getServletContext());
      ApplicationContextKeeper.init(ctx,servletConfig.getServletContext());
      
   }

   public void destroy()
   {
      super.destroy();

   }
}
